module.exports = async (ctx, next) => {
    let userId = ctx.session.userId
    if (!userId && ctx.path === '/') {
        ctx.redirect('/login');
    }else{
        await next();
    }
}


